\(\int \frac {c+d \tan (e+f x)}{(a+i a \tan (e+f x))^2} \, dx\) [1069]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [F(-2)]
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 26, antiderivative size = 80 \[ \int \frac {c+d \tan (e+f x)}{(a+i a \tan (e+f x))^2} \, dx=\frac {(c-i d) x}{4 a^2}+\frac {i c-d}{4 f (a+i a \tan (e+f x))^2}+\frac {i c+d}{4 f \left (a^2+i a^2 \tan (e+f x)\right )} \]

[Out]

1/4*(c-I*d)*x/a^2+1/4*(I*c-d)/f/(a+I*a*tan(f*x+e))^2+1/4*(I*c+d)/f/(a^2+I*a^2*tan(f*x+e))

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.115, Rules used = {3607, 3560, 8} \[ \int \frac {c+d \tan (e+f x)}{(a+i a \tan (e+f x))^2} \, dx=\frac {d+i c}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}+\frac {x (c-i d)}{4 a^2}+\frac {-d+i c}{4 f (a+i a \tan (e+f x))^2} \]

[In]

Int[(c + d*Tan[e + f*x])/(a + I*a*Tan[e + f*x])^2,x]

[Out]

((c - I*d)*x)/(4*a^2) + (I*c - d)/(4*f*(a + I*a*Tan[e + f*x])^2) + (I*c + d)/(4*f*(a^2 + I*a^2*Tan[e + f*x]))

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3560

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[a*((a + b*Tan[c + d*x])^n/(2*b*d*n)), x] +
Dist[1/(2*a), Int[(a + b*Tan[c + d*x])^(n + 1), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0] && LtQ[n
, 0]

Rule 3607

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-(
b*c - a*d))*((a + b*Tan[e + f*x])^m/(2*a*f*m)), x] + Dist[(b*c + a*d)/(2*a*b), Int[(a + b*Tan[e + f*x])^(m + 1
), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && LtQ[m, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {i c-d}{4 f (a+i a \tan (e+f x))^2}+\frac {(c-i d) \int \frac {1}{a+i a \tan (e+f x)} \, dx}{2 a} \\ & = \frac {i c-d}{4 f (a+i a \tan (e+f x))^2}+\frac {i c+d}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}+\frac {(c-i d) \int 1 \, dx}{4 a^2} \\ & = \frac {(c-i d) x}{4 a^2}+\frac {i c-d}{4 f (a+i a \tan (e+f x))^2}+\frac {i c+d}{4 f \left (a^2+i a^2 \tan (e+f x)\right )} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.86 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.11 \[ \int \frac {c+d \tan (e+f x)}{(a+i a \tan (e+f x))^2} \, dx=\frac {(c-i d) \arctan (\tan (e+f x))}{4 a^2 f}-\frac {i c-d}{4 a^2 f (i-\tan (e+f x))^2}-\frac {c-i d}{4 a^2 f (i-\tan (e+f x))} \]

[In]

Integrate[(c + d*Tan[e + f*x])/(a + I*a*Tan[e + f*x])^2,x]

[Out]

((c - I*d)*ArcTan[Tan[e + f*x]])/(4*a^2*f) - (I*c - d)/(4*a^2*f*(I - Tan[e + f*x])^2) - (c - I*d)/(4*a^2*f*(I
- Tan[e + f*x]))

Maple [A] (verified)

Time = 0.31 (sec) , antiderivative size = 73, normalized size of antiderivative = 0.91

method result size
risch \(-\frac {i x d}{4 a^{2}}+\frac {x c}{4 a^{2}}+\frac {i c \,{\mathrm e}^{-2 i \left (f x +e \right )}}{4 a^{2} f}-\frac {{\mathrm e}^{-4 i \left (f x +e \right )} d}{16 f \,a^{2}}+\frac {i {\mathrm e}^{-4 i \left (f x +e \right )} c}{16 f \,a^{2}}\) \(73\)
derivativedivides \(-\frac {i d \arctan \left (\tan \left (f x +e \right )\right )}{4 f \,a^{2}}+\frac {\arctan \left (\tan \left (f x +e \right )\right ) c}{4 f \,a^{2}}+\frac {c}{4 f \,a^{2} \left (\tan \left (f x +e \right )-i\right )}-\frac {i d}{4 f \,a^{2} \left (\tan \left (f x +e \right )-i\right )}-\frac {i c}{4 f \,a^{2} \left (\tan \left (f x +e \right )-i\right )^{2}}+\frac {d}{4 f \,a^{2} \left (\tan \left (f x +e \right )-i\right )^{2}}\) \(117\)
default \(-\frac {i d \arctan \left (\tan \left (f x +e \right )\right )}{4 f \,a^{2}}+\frac {\arctan \left (\tan \left (f x +e \right )\right ) c}{4 f \,a^{2}}+\frac {c}{4 f \,a^{2} \left (\tan \left (f x +e \right )-i\right )}-\frac {i d}{4 f \,a^{2} \left (\tan \left (f x +e \right )-i\right )}-\frac {i c}{4 f \,a^{2} \left (\tan \left (f x +e \right )-i\right )^{2}}+\frac {d}{4 f \,a^{2} \left (\tan \left (f x +e \right )-i\right )^{2}}\) \(117\)

[In]

int((c+d*tan(f*x+e))/(a+I*a*tan(f*x+e))^2,x,method=_RETURNVERBOSE)

[Out]

-1/4*I*x/a^2*d+1/4*x/a^2*c+1/4*I*c/a^2/f*exp(-2*I*(f*x+e))-1/16/f/a^2*exp(-4*I*(f*x+e))*d+1/16*I/f/a^2*exp(-4*
I*(f*x+e))*c

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 54, normalized size of antiderivative = 0.68 \[ \int \frac {c+d \tan (e+f x)}{(a+i a \tan (e+f x))^2} \, dx=\frac {{\left (4 \, {\left (c - i \, d\right )} f x e^{\left (4 i \, f x + 4 i \, e\right )} + 4 i \, c e^{\left (2 i \, f x + 2 i \, e\right )} + i \, c - d\right )} e^{\left (-4 i \, f x - 4 i \, e\right )}}{16 \, a^{2} f} \]

[In]

integrate((c+d*tan(f*x+e))/(a+I*a*tan(f*x+e))^2,x, algorithm="fricas")

[Out]

1/16*(4*(c - I*d)*f*x*e^(4*I*f*x + 4*I*e) + 4*I*c*e^(2*I*f*x + 2*I*e) + I*c - d)*e^(-4*I*f*x - 4*I*e)/(a^2*f)

Sympy [A] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 162, normalized size of antiderivative = 2.02 \[ \int \frac {c+d \tan (e+f x)}{(a+i a \tan (e+f x))^2} \, dx=\begin {cases} \frac {\left (16 i a^{2} c f e^{4 i e} e^{- 2 i f x} + \left (4 i a^{2} c f e^{2 i e} - 4 a^{2} d f e^{2 i e}\right ) e^{- 4 i f x}\right ) e^{- 6 i e}}{64 a^{4} f^{2}} & \text {for}\: a^{4} f^{2} e^{6 i e} \neq 0 \\x \left (- \frac {c - i d}{4 a^{2}} + \frac {\left (c e^{4 i e} + 2 c e^{2 i e} + c - i d e^{4 i e} + i d\right ) e^{- 4 i e}}{4 a^{2}}\right ) & \text {otherwise} \end {cases} + \frac {x \left (c - i d\right )}{4 a^{2}} \]

[In]

integrate((c+d*tan(f*x+e))/(a+I*a*tan(f*x+e))**2,x)

[Out]

Piecewise(((16*I*a**2*c*f*exp(4*I*e)*exp(-2*I*f*x) + (4*I*a**2*c*f*exp(2*I*e) - 4*a**2*d*f*exp(2*I*e))*exp(-4*
I*f*x))*exp(-6*I*e)/(64*a**4*f**2), Ne(a**4*f**2*exp(6*I*e), 0)), (x*(-(c - I*d)/(4*a**2) + (c*exp(4*I*e) + 2*
c*exp(2*I*e) + c - I*d*exp(4*I*e) + I*d)*exp(-4*I*e)/(4*a**2)), True)) + x*(c - I*d)/(4*a**2)

Maxima [F(-2)]

Exception generated. \[ \int \frac {c+d \tan (e+f x)}{(a+i a \tan (e+f x))^2} \, dx=\text {Exception raised: RuntimeError} \]

[In]

integrate((c+d*tan(f*x+e))/(a+I*a*tan(f*x+e))^2,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: expt: undefined: 0 to a negative exponent.

Giac [A] (verification not implemented)

none

Time = 0.43 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.38 \[ \int \frac {c+d \tan (e+f x)}{(a+i a \tan (e+f x))^2} \, dx=-\frac {\frac {2 \, {\left (-i \, c - d\right )} \log \left (\tan \left (f x + e\right ) + i\right )}{a^{2}} - \frac {2 \, {\left (-i \, c - d\right )} \log \left (\tan \left (f x + e\right ) - i\right )}{a^{2}} - \frac {3 i \, c \tan \left (f x + e\right )^{2} + 3 \, d \tan \left (f x + e\right )^{2} + 10 \, c \tan \left (f x + e\right ) - 10 i \, d \tan \left (f x + e\right ) - 11 i \, c - 3 \, d}{a^{2} {\left (\tan \left (f x + e\right ) - i\right )}^{2}}}{16 \, f} \]

[In]

integrate((c+d*tan(f*x+e))/(a+I*a*tan(f*x+e))^2,x, algorithm="giac")

[Out]

-1/16*(2*(-I*c - d)*log(tan(f*x + e) + I)/a^2 - 2*(-I*c - d)*log(tan(f*x + e) - I)/a^2 - (3*I*c*tan(f*x + e)^2
 + 3*d*tan(f*x + e)^2 + 10*c*tan(f*x + e) - 10*I*d*tan(f*x + e) - 11*I*c - 3*d)/(a^2*(tan(f*x + e) - I)^2))/f

Mupad [B] (verification not implemented)

Time = 5.39 (sec) , antiderivative size = 70, normalized size of antiderivative = 0.88 \[ \int \frac {c+d \tan (e+f x)}{(a+i a \tan (e+f x))^2} \, dx=\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (\frac {d}{4\,a^2}+\frac {c\,1{}\mathrm {i}}{4\,a^2}\right )+\frac {c}{2\,a^2}}{f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}+2\,\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )}-\frac {x\,\left (d+c\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{4\,a^2} \]

[In]

int((c + d*tan(e + f*x))/(a + a*tan(e + f*x)*1i)^2,x)

[Out]

(tan(e + f*x)*((c*1i)/(4*a^2) + d/(4*a^2)) + c/(2*a^2))/(f*(2*tan(e + f*x) + tan(e + f*x)^2*1i - 1i)) - (x*(c*
1i + d)*1i)/(4*a^2)